/* 
 登录面板
 */
function loginPanel(){
	let html = `
		<div class="left_panel panel " style="display:block;height:222px;z-index:9999">
			  <h2 style="text-align:center;height:55px;line-height:55px"> 插件登录 </h2>
			  <div class="layui-form-item">
				<label class="layui-form-label" style="width:110px">请输入账号</label>
				<div class="layui-input-inline">
				  <input type="text" placeholder="请输入账号"  class="layui-input username">
				</div>
			  </div>
			  <div class="layui-form-item">
				<label class="layui-form-label"  style="width:110px">请输入密码</label>
				<div class="layui-input-inline">
				  <input type="password"   placeholder="请输入密码"  class="layui-input password">
				</div>
			  </div>
			 <div class="layui-form-item">
				<div class="layui-input-block">
				  <button class="layui-btn login_btn" >立即登录</button>
				</div>
			 </div>
		</div>
	`;
	return html;
}
function logoutBtn(){
	let btn = `
		<button class="btn_jw logout_btn" style="position: fixed;left: 20px;top:140px;z-index:9999">用户登出</button>
	`;
	return btn;
}

/* 
有好货采集面板
 */
function hhCollectPanel(){
	let html = `
		<div class="left_panel panel" style="display:block;z-index:9999">
	
			<button class="btn_jw collectBtn" style="margin-left:15px;margin-top:15px;background:rgba(150,155,250,144);" >单品按钮</button>
			<button class="btn_jw listBtn" style="margin-left:15px;margin-top:15px;background:rgba(150,155,250,144);" >列表按钮</button>
			<div class="hh_collect_process" style="width:350px;height:400px;overflow:auto;margin:10px auto">
			</div>
		</div>
	`;
	
	return html;
}

//头条采集面板
function ttCollectPanel(){
	let html = `
		<div class="left_panel panel" style="display:block;z-index:9999">
			<div style="margin:15px;height:30px">
				<input type="radio" value="1" class="mode" name="mode" style="zoom:150%;" checked><label style="vertical-align:4px;margin-left:5px">按时间</label>
				<input type="radio" value="2" class="mode" name="mode" style="zoom:150%;margin-left:5px"><label style="vertical-align:4px;margin-left:5px">按篇章</label>
			</div>
			
			
			<div class="sjjq" style="margin-left:15px;margin-top:10px;display:block">
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="年"  class="layui-input start_year">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="月"  class="layui-input start_month">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="日"  class="layui-input start_day">
				</div>
				
				---
				
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="年"  class="layui-input end_year">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="月"  class="layui-input end_month">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="日"  class="layui-input end_day">
				</div>
			</div>
			
		   
			<div class="layui-input-inline psjq" style="margin-left:15px;margin-top:10px;display:none">
			  <div class="layui-input-inline" style="width:120px">
				<input type="text" placeholder="开始篇数"  class="layui-input start_index">
			  </div>
			  
			  ---
			  <div class="layui-input-inline" style="width:120px">
			    <input type="text" placeholder="结束篇数"  class="layui-input end_index">
			  </div>
			</div>
			<button class="btn_jw userHomeBtn" style="margin-left:40px;margin-top:15px;background:rgba(150,50,250,144);" >开始搬运!</button>
			<div class="tt_collect_process" style="width:350px;height:400px;overflow:auto;margin:10px auto">
			</div>
		</div>
	`;
	return html;
}

//腾讯网采集面板
function newsCollectPanel(){
	let html = `
		<div class="left_panel panel" style="display:block;z-index:9999">
			<div style="margin:15px;height:30px">
				<input type="radio" value="1" class="mode" name="mode" style="zoom:150%;" checked><label style="vertical-align:4px;margin-left:5px">按时间</label>
				<input type="radio" value="2" class="mode" name="mode" style="zoom:150%;margin-left:5px"><label style="vertical-align:4px;margin-left:5px">按篇章</label>
			</div>
			
			
			<div class="sjjq" style="margin-left:15px;margin-top:10px;display:block">
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="年"  class="layui-input start_year">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="月"  class="layui-input start_month">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="日"  class="layui-input start_day">
				</div>
				
				---
				
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="年"  class="layui-input end_year">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="月"  class="layui-input end_month">
				</div>
				<div class="layui-input-inline" style="width:50px">
				  <input type="text" placeholder="日"  class="layui-input end_day">
				</div>
			</div>
			
					   
			<div class="layui-input-inline psjq" style="margin-left:15px;margin-top:10px;display:none">
			  <div class="layui-input-inline" style="width:120px">
				<input type="text" placeholder="开始篇数"  class="layui-input start_index">
			  </div>
			  
			  ---
			  <div class="layui-input-inline" style="width:120px">
			    <input type="text" placeholder="结束篇数"  class="layui-input end_index">
			  </div>
			</div>
			<button class="btn_jw newsUserHomeBtn" style="margin-left:40px;margin-top:15px;background:rgba(150,50,250,144);" >开始搬运!</button>
			<div class="news_collect_process" style="width:350px;height:400px;overflow:auto;margin:10px auto">
			</div>
		</div>
	`;
	return html;
}



/* 
 资源发布面板
 */
function sourcePubPanel(){
	let html = `
		<div class="left_panel panel" style="display:block;z-index:9999">
			 <div class="layui-form-item" style='margin-top:15px'>
				<label class="layui-form-label" style="width:100px;font-size:17px">发布数量</label>
				<div class="layui-input-inline">
				  <input type="text" placeholder="请输入你要发表的篇数"  class="layui-input pub_num">
				</div>
			</div>
			<button class="btn_jw source_pub" style="margin-left:15px;background:rgba(150,155,250,144);" >开始发布</button>
			<div class="source_pub_process" style="width:350px;height:400px;overflow:auto;margin:10px auto">
			</div>
		</div>
	`;
	
	return html;
}


/* 
缩放按钮 
 */
function shrinkBtn(name = '缩放按钮'){
	let btn = `
		<button class="btn_jw btn_shrink " style="z-index:9999">${name}</button>
	`;
	return btn;
}

/* 
 添加话术
 */
//进度条添加数据
function wordsPrepend(that = '',word = '',type = 0){
	template = '';
	if(type == 0){
		template = `<p style="padding:5px 5px 5px 15px;color:blue;font-weight:bold">${word}</p>`;
	}
	if(type == 1){
		template = `<p style="padding:5px 5px 5px 15px;color:green;font-weight:bold">${word}</p>`;
	}
	if(type == 2){
		template = `<p style="padding:5px 5px 5px 15px;color:red;font-weight:bold">${word}</p>`;
	}
	that.prepend(template);
}





/*
 点击按钮缩放
 */
$('html body').on('click','.btn_shrink',function () {
	style = $('.left_panel').attr('style');
	
	if(style.indexOf('block') != -1){
		$('.left_panel').css('display','none');
	}else{
		$('.left_panel').css('display','block');
	}
})